package com.pie4cloud.pie.bus.api.feign;

import com.pie4cloud.pie.bus.api.dto.MessageDto;
import com.pie4cloud.pie.bus.api.dto.ConsumerDto;
import com.pie4cloud.pie.common.core.constant.SecurityConstants;
import com.pie4cloud.pie.common.core.constant.ServiceNameConstants;
import com.pie4cloud.pie.common.core.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

@FeignClient(contextId = "remoteKfkService", value = ServiceNameConstants.BUS_SERVICE)
public interface RemoteKafkaSendService {
	@PostMapping("/kfk/sendKafka")
	R sendKafka(@RequestBody MessageDto messageDto, @RequestHeader(SecurityConstants.FROM) String from);

	@PostMapping("/kfk/sendConsumer")
	R sendConsumer(@RequestBody ConsumerDto consumerDto, @RequestHeader(SecurityConstants.FROM) String from);

	@PostMapping("/kfk/sendKafkas")
	R sendKafkas(@RequestBody List<MessageDto> messageDto, @RequestHeader(SecurityConstants.FROM) String from);
}
